/**
 * Copyright (c) 2010-2011 Pierre Labatut
 *
 * This file is part of Space-Chronicles project.
 *
 * Space-Chronicles is free software: you can redistribute it and/or modify it
 * under the terms of its license which may be found in the accompanying
 * LICENSE file or <http://code.google.com/p/space-chronicles/>.
 */
package space.game;

import space.game.config.CfgCancelApplication;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import space.debug.DbgError;
import space.debug.GlobalParameters;
import space.debug.tune.Tunner;

/**
 *
 * @author Pierre
 */
public class FwMain {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {

        /**
         * On error, a dedicated handler shows a pannel
         */
        Thread.currentThread().setUncaughtExceptionHandler(DbgError.handler());

        /**
         * Set nimbus as default Look and Feel
         */
        try {
            for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (Exception ex) {
            Logger.getLogger(FwMain.class.getName()).log(Level.SEVERE, null, ex);
        }



        try {

           
           
            final FwEnvironment fwk = FwEnvironment.initialize();
            fwk.run();


        } catch (CfgCancelApplication ex) {
            ex.printStackTrace();
            Logger.getLogger(FwMain.class.getName()).log(Level.SEVERE, null, ex);
        }


    }
}
